/// <reference path="../../Resources/js/jquery/jquery.debug.js" />

Type.registerNamespace("BM");

BM.MinimizeButton = {
    SectionCollapsed: "SC",

    switchImg: function(item, state) {
        if (state == 1) {
            item.src = item.src.replace(/_1/, "_2");
        } else {
            item.src = item.src.replace(/_2/, "_1");
        }        
    },

    showHideSection: function(node) {
        var sectionNode = $(node.parentNode.parentNode.parentNode);
        if (sectionNode.hasClass(BM.MinimizeButton.SectionCollapsed)) {
            sectionNode.removeClass(BM.MinimizeButton.SectionCollapsed);
            node.src = node.src.replace(/_down_/, "_up_");
        } else {
            sectionNode.addClass(BM.MinimizeButton.SectionCollapsed);
            node.src = node.src.replace(/_up_/, "_down_");
        }
    }
}